import request from '@/utils/request'

export interface UpdateProfileParams {
  email?: string
  phone?: string
  oldPassword?: string
  newPassword?: string
}

// 获取用户信息
export const getUserProfile = () => {
  return request.get('/api/users/current')
}

// 更新用户信息
export const updateUserProfile = (data: UpdateProfileParams) => {
  return request.put('/api/users/profile', data)
}

// 更新密码
export const updatePassword = (data: { oldPassword: string; newPassword: string }) => {
  return request.put('/api/users/password', data)
}
